Option Explicit
'ۭqҲ
Dim mySpn As Boolean
Private Sub UserForm_Initialize()
    With SpinButton1
        'wLիsݩ
        .Max = 50
        .Min = 1
        .SmallChange = 1
        .Value = 25
    End With
    TextBox1.TextAlign = fmTextAlignRight
End Sub

Private Sub SpinButton1_Change()
    mySpn = True
    TextBox1.Value = SpinButton1.Value
    mySpn = SpinButton1.Value
End Sub

Private Sub SpinButton1_SpinDown()
    With SpinButton1
        If mySpn = False Then
            If .Value = .Min Then .Value = .Max
        End If
    End With
    mySpn = False
End Sub

Private Sub SpinButton1_SpinUp()
    With SpinButton1
        If mySpn = False Then
            If .Value = .Max Then .Value = .Min
        End If
    End With
    mySpn = False
End Sub
